/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Datos;
import java.sql.*; 
public class test 
{ 
    static String bd = "sysinventario"; 
    static String login = "root"; 
    
    static String password = "1234"; 
    static String url = "jdbc:mysql://localhost/"+bd; 
    public static void main(String[] args) 
            throws Exception 
    { 
        Connection conn = null; 
        try 
        { 
            Class.forName("com.mysql.jdbc.Driver").newInstance(); 
            conn = DriverManager.getConnection(url,login,password); 
            if (conn != null) 
            { 
                System.out.println("Conexión a base de datos "+url+" ... Ok"); 
                conn.close(); 
            } 
        } 
        catch(SQLException ex) 
        { 
            System.out.println("Hubo un problema al intentar conectarse con la base de datos "+url); 
        } 
        catch(ClassNotFoundException ex) 
        { 
            System.out.println(ex); 
        }
    }
}